<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { appVersionCheck } from '@aurouscia/vite-app-version/check';
import Prompt from './base/Prompt.vue';

const outdated = ref(false)
onMounted(async()=>{
    outdated.value = !(await appVersionCheck())
})
function reload(){
    window.location.reload()
}
</script>

<template>
<Prompt v-if="outdated" @close="outdated=false" :z-index="60000">
    <h2>有新版本</h2>
    <div>请刷新浏览器获取新版</div>
    <button @click="reload">点击刷新</button>
</Prompt>
</template>

<style lang="scss" scoped>

</style>